<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>递归</title>
  </head>
  <body>
    <script>
      function text(num) {
        console.log(num);
        num++;
        // text(num);   //会陷入死循环
        return num <= 10 ? text(num) : "num数字过大,超限了!";
      }
      console.log(text(1));
    </script>
  </body>
</html>
